<?php
/**
 * Created by PhpStorm.
 * User: dev
 * Date: 24/10/14
 * Time: 6:45 PM
 */




class Member_Home_Controller extends Base_Controller {

    public $restful = true;

    public function __construct()
    {
        parent::__construct();
        //--Your Code --//

        $this->theme->set_theme("default") ;
        $this->theme->set_layout("member") ;

        $this->filter('before', 'role');

    }

    public function get_index(){




        $mem_id = Auth::user()->id;

        $data['posts'] = Users::find($mem_id)->post()
            ->select(array('id','title','status','hit'))
            ->get();
        
       // dd($data['posts']);
        /*-- META DATA */
        $data['title'] = "Member Dashboard";
        $this->theme->title($data['title'].' - '.Settings::get('en','site_title'));
        /*-- BREADCRUMB */
        	
        Breadcrumb::addbreadcrumb('Home', URL::base());
        Breadcrumb::addbreadcrumb($data['title'], URL::base());
        Breadcrumb::setSeparator('&raquo;');
        $data['breadcrumb'] = Breadcrumb::generate();
        
        
        return $this->theme->render('member::index', $data);
    }

    
    
} 